<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        li:first-child{
            background-color: green;
        }

        li:last-child{
            background-color: green;
        }

        li:nth-child(3){
            background-color: green;
        }

    </style>
</head>
<body>
    <ul>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
        <li>li 1</li>
    </ul>
</body>
</html>